Optimize GAE startup and fix OGC/migration regressions#594
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces cold-start overhead and simplifies a single-service GAE deployment. The specific diff shown here fixes an OGC import regression by correcting the import path for to_bool — moving it from the nonexistent services.util.to_bool to the correct services.env.to_bool. The broader PR description covers lazy-loading of admin routes, GAE deploy cleanup, Alembic migration additions, and startup/request timing logs, but only the query_helper.py change is included in this diff.
Changes:
- Fixes
to_boolimport inservices/query_helper.pyfromservices.util(where it never existed) toservices.env(the correct location)
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR reduces App Engine cold-start overhead, simplifies the current single-service deployment path, and fixes regressions uncovered during the startup refactor.
What changed
Startup and runtime
/adminaccessSESSION_SECRET_KEY;/adminnow returns a clear503when that secret is unsetDeploy and local dev
db+appentrypoint.shparameterized, with migrations enabled by default for local devDatabase and OGC fixes
ogc_water_elevation_wellsfor databases that recorded the earlier revision but still have the old materialized view definitionservices.env.to_boolCode cleanup
services/env.pyValidation
Ran:
pytest tests/test_lazy_admin.py tests/test_request_timing.py tests/test_ogc.py tests/test_admin_views.py tests/integration/test_alembic_migrations.py tests/test_cli_commands.py -q55 passed, 3 skippedpytest tests/test_ogc.py -q12 passed, 2 skippedAlso verified:
Notes
CLOUD_SQL_USER